home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / SAS-C / sc655pch / guiprof / guiprof.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  1.7 KB  |  43 lines

  1. /*************************************************************/
  2. /*                                                           */
  3. /* You don't need to include this file at all unless you     */
  4. /* want to disable profiling for short portions of your      */
  5. /* program.  A good example would be disabling the profiler  */
  6. /* while you call Wait() to wait on user input.  To do this, */
  7. /* surround your Wait() call with PROFILE_OFF and PROFILE_ON */
  8. /* macros as shown:                                          */
  9. /*                                                           */
  10. /*    PROFILE_OFF();                                         */
  11. /*    result = Wait(waitbits);                               */
  12. /*    PROFILE_ON();                                          */
  13. /*                                                           */
  14. /* Special note:  ALWAYS USE THE CALLS AS SHOWN.  Surround   */
  15. /*                a simple function call with them.  Do NOT  */
  16. /*                return from the function in which you      */
  17. /*                called PROFILE_OFF without calling         */
  18. /*                PROFILE_ON first.  Do NOT call PROFILE_ON  */
  19. /*                without having called PROFILE_OFF in the   */
  20. /*                same function.  If you do, the profiler's  */
  21. /*                results will be incorrect!                 */
  22. /*                                                           */
  23. /*************************************************************/
  24.  
  25. #if _USE_PROFILING
  26.  
  27. void __asm _PROLOG(register __a0 char *);
  28. void __asm _EPILOG(register __a0 char *);
  29.  
  30. #define PROFILE_OFF() _PROLOG(NULL)
  31. #define PROFILE_ON()  _EPILOG(NULL)
  32.  
  33. #define PROFILE_PUSH(x) _PROLOG(x)
  34. #define PROFILE_POP(x)  _EPILOG(x)
  35.  
  36. #else
  37.  
  38. #define PROFILE_OFF() {}
  39. #define PROFILE_ON()  {}
  40.  
  41. #endif
  42.  
  43.